<%--
  Created by IntelliJ IDEA.
  User: yuan22456
  Date: 2024/9/15
  Time: 19:35
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>图书展示</title>
    <link rel="stylesheet" type="text/css" href="css/header.css">
    <link rel="stylesheet" type="text/css" href="css/bookList.css">
</head>
<body>
<header>
    <nav>
        <ul>
            <li><a href="index.jsp">首页</a></li>
            <li><a href="insert.jsp">添加图书</a></li>
            <li><a href="BookAction?hidden=bookList">管理图书</a></li>
            <li><a href="more.jsp">更多</a></li>
        </ul>
    </nav>
</header>

<div id="bg">
    <div id="table">
        <form action="BookAction" method="post">
        <div id="search">
                <select name="sel" id="selectBut">
                    <option value="isbn">ISBN</option>
                    <option value="name">书名</option>
                    <option value="price">价格</option>
                    <option value="press">出版社</option>
                </select>
                <input type="text" name="input" id="input">
                <input type="submit" value="🔍" id="sub">
                <input type="hidden" name="hidden" value="search">
        </div>
        </form>
        <table>
            <thead>
            <tr>
                <th>序号</th>
                <th>编号</th>
                <th>书名</th>
                <th>单价(元)</th>
                <th>出版社</th>
                <th colspan="2">操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${requestScope.bookList}" var="book">
                <tr>
                    <td>${book.id}</td>
                    <td>${book.isbn}</td>
                    <td>${book.name}</td>
                    <td>${book.price}</td>
                    <td>${book.press}</td>
                    <td><a href="BookAction?hidden=findId&id=${book.id}" class="modify">修改</a></td>
                    <td><a href="BookAction?hidden=delete&id=${book.id}" class="modify">删除</a></td>
                </tr>
            </c:forEach>
            </tbody>
        </table>

        <div id="list">
            <span class="space" id="txt">第${page.currentPage}页/共${page.totalPage}页</span>
            <a href="BookAction?hidden=${hidden}&cur=${page.currentPage - 1}" class="space" id="up">上一页</a>
            <a href="BookAction?hidden=${hidden}&cur=${page.currentPage + 1}" class="space" id="down">下一页</a>
        </div>
    </div>
</div>
</body>
</html>
